﻿
@{
    ViewBag.Title = "AddUser";
    Layout = "~/Views/Shared/_LayoutPay.cshtml";
}
@model List<Pay.Model.Model.RoleInfo>
<link href="~/Content/layui.css" rel="stylesheet" />
@section scripts{
    <script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
    <script src="~/Scripts/layer.js"></script>
    <script>
        function addSuccess(data) {
            parent.layer.msg(data.msg);
        }
    </script>
}
<div class="ibox-content">
    @using (Ajax.BeginForm("AddUser", null, new AjaxOptions { HttpMethod = "post", OnSuccess="addSuccess", UpdateTargetId = "articles", InsertionMode = InsertionMode.Replace }, new { id = "search", @class = "form-horizontal" }))
    {
        <input type="hidden" name="Type" value="@ViewBag.UserType" />
        <div class="form-group">
            <label class="col-sm-3 control-label">用户名：</label>
            <div class="col-sm-8">
                <input type="text" placeholder="用户名" class="form-control" name="UserName" maxlength="18" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">密码：</label>
            <div class="col-sm-8">
                <input type="password" placeholder="密码" class="form-control" name="Pwd" maxlength="18" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">角色：</label>
            <div class="col-sm-8">
                <select name="Role" class="layui-input layui-unselect" required>
                    @if (Model != null && Model.Any())
                    {

                        foreach (var item in Model)
                        {
                            <option value="@item.Id">@item.RoleName</option>
                        }
                    }
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-3 col-sm-8">
                <input class="btn btn-primary" type="submit" value="确定">
                <input class="btn btn-restore" type="reset" value="重置">
            </div>
        </div>
    }
</div>